#{extends 'main.html' /}
#{set title:'Current_Bookings' /}

<!-- Current Bookings -->

<h1>Current Bookings</h1>

#{ifnot bookings}
    <p>
        No Bookings Found
    </p>
#{/ifnot}
#{else}
   <table>
       <thead>
           <tr>
               <th>Komponent name</th>
               <th>Check in</th>
               <th>Check out</th>
               <th>Note</th>
               <th>Confirmation number</th>
               <th>Action</th>
           </tr>
       </thead>
       <tbody>
           #{list bookings, as:'booking'}
               <tr>
                   <td>${booking.komponent.komp_name}</td>                  
                   <td>${booking.checkinDate.format('yyyy-MM-dd')}</td>
                   <td>${booking.checkoutDate.format('yyyy-MM-dd')}</td>
                   <td>${booking.book_note}</td>
                   <td>${booking.id}</td>
                   <td>
                        #{a @cancelBooking(booking.id)}Cancel#{/a}
                   </td>
               </tr>
           #{/list}
       </tbody>
   </table> 
#{/else}